/* 个人中心页面样式 */

.profile-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* 侧边栏 */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.user-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.user-avatar {
    margin-bottom: 1rem;
}

.user-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
}

.user-info {
    margin-bottom: 1.5rem;
}

.user-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.user-join-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.user-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* 导航菜单 */
.profile-nav {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.profile-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.profile-nav .nav-item:last-child {
    margin-bottom: 0;
}

.profile-nav .nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.profile-nav .nav-item.active {
    background: var(--primary-color);
    color: white;
}

.profile-nav .nav-item .icon {
    font-size: 1.1rem;
}

/* 主内容区 */
.profile-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    min-height: 600px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.content-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 帖子列表 */
.posts-list,
.favorites-list,
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.post-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.post-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.post-item-title:hover {
    color: var(--primary-color);
}

.post-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.post-item-excerpt {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.post-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-item-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.post-item-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-sm:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.action-btn-sm.edit {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.action-btn-sm.delete {
    color: #dc3545;
    border-color: #dc3545;
}

.action-btn-sm.delete:hover {
    background: #dc3545;
    color: white;
}

/* 评论项 */
.comment-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.comment-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.comment-post-title {
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.comment-post-title:hover {
    text-decoration: underline;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.comment-content {
    color: var(--text-primary);
    line-height: 1.5;
}

/* 设置表单 */
.settings-form {
    max-width: 600px;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-group input[readonly] {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* 复选框样式 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkmark {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* 模态框大尺寸 */
.modal-large .modal-content {
    max-width: 800px;
    width: 90vw;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .profile-layout {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
    
    .user-card {
        padding: 1.5rem;
    }
    
    .profile-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .profile-sidebar {
        order: 2;
    }
    
    .profile-content {
        order: 1;
        padding: 1rem;
    }
    
    .user-card {
        padding: 1rem;
    }
    
    .user-avatar img {
        width: 80px;
        height: 80px;
    }
    
    .user-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .post-item-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .post-item-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .post-item-actions {
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-large .modal-content {
        width: 95vw;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .profile-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .profile-nav .nav-item {
        margin-bottom: 0;
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.75rem 0.5rem;
    }
    
    .post-item {
        padding: 1rem;
    }
    
    .post-item-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .post-item-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
}